/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Chatree Siangklom
 * Created On : Dec 21, 2012  5:26:32 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : apps
 * File Name : EmPromisServiceSqlExecution.java
 * TODO
 */
package apps;

import java.util.List;
import org.apache.log4j.Logger;
import promis.utility.CommonService;

/**
 * @author Chatree Siangklom of Administrator
 * Date =Nov 13, 2013 : 2:25:57 PM 
 * CreateBy=Chatree Siangklom
 * 
 * EmPromisServiceSqlExecution
 * TODO
 */
public class EmPromisServiceSqlExecution {
	
	private static final Logger log = Logger.getLogger(EmPromisServiceSqlExecution.class);

	/**
	 * Date =Nov 13, 2013 : 2:26:04 PM 
	 * CreateBy=Chatree Siangklom
	 * List<Object[]>
	 * TODO
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public List<Object[]> ExecuteQuery(String sql) throws Exception {
		try{
			if(!CommonService.IsNull(sql)){
				return (List<Object[]>)sessionFactory.CreateEmPromis().createNativeQuery(sql).getResultList();
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}

}
